package com.heima.behavior.controller.v1;

import com.heima.behavior.service.LikesBehaviorService;
import com.heima.model.behavior.dtos.LikesBehaviorDto;
import com.heima.model.behavior.dtos.ReadBehaviorDto;
import com.heima.model.common.dtos.ResponseResult;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 点赞行为
 */
@RestController
@RequestMapping("/api/v1")
public class LikesBehaviorController {

    @Autowired
    private LikesBehaviorService likesBehaviorService;

    /**
     * 点赞行为
     * @param dto
     * @return
     */
    @PostMapping("/likes_behavior")
    public ResponseResult likes(@RequestBody LikesBehaviorDto dto){

        return likesBehaviorService.likes(dto);
    }
    /**
     * 阅读行为
     */
    @PostMapping("/read_behavior")
    public ResponseResult read(@RequestBody ReadBehaviorDto dto){
        return likesBehaviorService.read(dto);
    }

}
